<cfcomponent displayname="User" output="false">


	<!--- Remote methods --->


	<cffunction name="getAll" access="remote" returntype="array" roles="administrator">
		<cfset var local = StructNew() />
<!---
		<cfset structDelete(application, "servicefactory") />
		<cfset application.servicefactory = createObject("component", "coldspring.beans.DefaultXmlBeanFactory").init() />
		<cfset application.servicefactory.loadBeansFromXmlFile(beanDefinitionFile="#ExpandPath('/coldspring.xml')#") />
 --->
		<cfset local.oCUser = application.servicefactory.getBean("UserCollection") />
		<cfset local.oCUser.getAll() />
		<cfreturn local.oCUser.getObjectSet(true) />
	</cffunction>

	<cffunction name="setPassword" access="remote" returntype="boolean" roles="administrator">
		<cfargument name="userId" type="any" required="true" hint="This is a JSON version of the oUser, and won't validate type." />
		<cfargument name="sNewPassword" type="string" required="true" />
		<cfscript>
			var local = StructNew();
			local.oUser = CreateObject("component", "revenea.account.data.User").init(arguments.userId);
			return local.oUser.getDAO().setPassword(local.oUser, arguments.sNewPassword);
		</cfscript>
	</cffunction>


</cfcomponent>